package com.rk.admin;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rk.admin.domain.Briefinfo;
import com.rk.admin.mapper.BriefInfoMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class springtest {


    @Autowired
    private BriefInfoMapper briefInfoMapper;

    /**
     * 分页查询
     */
    @Test
    public void testselectPage(){
        IPage page=new Page(1,2);
        briefInfoMapper.selectPage(page,null);
        System.out.println("当前页码值:"+page.getCurrent());
        System.out.println("每页显示数:"+page.getSize());
        System.out.println("总条数:"+page.getTotal());
        System.out.println("一共多少页:"+page.getPages());
        System.out.println("数据:"+page.getRecords());
    }

    /**
     * 查询全部
     */
     @Test
     public void testfindAll(){
        List<Briefinfo> briefinfos = briefInfoMapper.selectList(null);
        System.out.println(briefinfos);
    }


}
